package lab02.test11;

class rectangle implements Printx{//实现类

  double l1,l2;

           @Override

  public void printMyWay() {

              System.out.println("显示矩形边长分别为:"+l2+" "+l1+" "+"矩形周长为:"+this.perimeter()+" "+"矩形面积为:"

                      +this.area());

               }

    @Override

   public double length() {

              return l1+l2;

           }



           @Override

   public double area() {

               return l1*l2;

        }



        @Override

  public double perimeter() {

              return (l1+l2)*2;

          }



          @Override

   public double diagonal() {

                return 0;

          }

        }